<?php
/**
 * Created by PhpStorm.
 * Script Name: MiniTester.php
 * Create: 2020/5/23 下午4:22
 * Description: 小程序体验账号
 * Author: fudaoji<fdj@kuryun.cn>
 */

namespace plugin\wechat\app\validate;

use app\common\validate\Common;

class MiniReg extends Common
{
    public function __construct()
    {
        parent::__construct();
    }

    protected $rule = [
        'name'  =>  'require',
        'code'  => 'require',
        'legal_persona_wechat'  =>  'require',
        'legal_persona_name'  => 'require',
        'nick_name'  =>  'require|min:2|max:30',
    ];

    //错误消息
    protected $message  =   [
        'name.require' => '企业名称必填',
        'code.require' => '企业代码必填',
        'legal_persona_wechat.require' => '法人微信必填',
        'legal_persona_name.require' => '法人姓名必填',
        'nick_name' => '小程序名称不合法',
    ];

    /**
     * add 验证场景定义
     * @return self
     * @author: fudaoji<fdj@kuryun.cn>
     */
    public function sceneAdd()
    {
        return $this->only(['__token__','name','code','legal_persona_wechat', 'legal_persona_name']);
    }

    /**
     * 试用小程序注册 验证场景定义
     * @return self
     * @author: fudaoji<fdj@kuryun.cn>
     */
    public function sceneFastReg()
    {
        return $this->only(['__token__','nick_name']);
    }
}